package com.sjgs.gis.domain;

import com.sjgs.common.utils.UUIDUtils;
import com.sjgs.gis.domain.enumeration.TileSetType;
import lombok.*;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@ToString
@EqualsAndHashCode
@Data
public class TileSet implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 全局uuid,作为资源key前缀
     */
    String uid = Long.toUnsignedString(UUIDUtils.nextShortId(), 32);

    /**
     * 资源名称
     */
    String name = "";

    /**
     * 资源类型Url
     */
    TileSetType type = TileSetType.IMAGE;

    /**
     * 资源结构描述json路径
     * layer.json/tileset.json
     */
    String schemaUrl = "";

    /**
     * 瓦片元数据描述json路径
     * scenetree.json
     */
    String metadataUrl = "";

    /**
     * 瓦片所有路径
     * 临时变量不需要序列化
     */

    transient List<String> tiles = new ArrayList<>();

    /**
     * geometry wkt for viewpoint
     * Geometry.CreateFromWkt("") => Geometry
     */
    String geomWkt = "";

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public TileSetType getType() {
        return type;
    }

    public void setType(TileSetType type) {
        this.type = type;
    }

    public String getSchemaUrl() {
        return schemaUrl;
    }

    public void setSchemaUrl(String schemaUrl) {
        this.schemaUrl = schemaUrl;
    }

    public String getMetadataUrl() {
        return metadataUrl;
    }

    public void setMetadataUrl(String metadataUrl) {
        this.metadataUrl = metadataUrl;
    }

    public List<String> getTiles() {
        return tiles;
    }

    public void setTiles(List<String> tiles) {
        this.tiles = tiles;
    }

    public String getGeomWkt() {
        return geomWkt;
    }

    public void setGeomWkt(String geomWkt) {
        this.geomWkt = geomWkt;
    }
}
